package com.apes.auto.car.service;

import com.apes.auto.car.model.PartsElectronicCatalogue;
import com.apes.auto.car.repository.PartsElectronicCatalogueRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName PartElectronicCatalogueService
 * @Description TODO
 * @Author pengyb
 * @Date 2019/8/2 18:02
 * @Version 1.0
 **/
@Service("partsElectronicCatalogueService")
public class PartElectronicCatalogueService extends DomainService {

    @Autowired
    private PartsElectronicCatalogueRepository repository;

    public PartsElectronicCatalogue save(SimpleRequest request) {
        PartsElectronicCatalogue o = request.getO(PartsElectronicCatalogue.class);
        return repository.saveAndFlush(o);
    }

    public String delete(SimpleRequest request) {
        PartsElectronicCatalogue o = request.getO(PartsElectronicCatalogue.class);
        repository.delete(o);
        return "删除成功";
    }
}
